<!--

Saherace - Rent a Car

This page shows a list of all available stations. There is
also a search for stations.

-->

<?php

//Include the soap client connection and the header area of the website
include('includes/header.php');

//Get all stations from webservice
$getStations = $client->getStations();

?>
<br />
<br />
<br />

<!-- List all stations with search filter (supported by jquery-mobile plugin) -->
<ul data-role="listview" data-inset="true" data-filter="true">
	<li data-role="list-divider">Stationen</li>
	
	<?php
	
	//If theres more than one station
	if (sizeof($getStations->return) > 1) {
		//link each station with detail page of the station
		for($i = 0; $i<sizeof($getStations->return); $i++){
			echo '<li><a href="station_details.php?station_id='.$getStations->return[$i]->station_id.'">'.$getStations->return[$i]->city.'</a></li>';
		}
		
	//If theres only one station
	} else {
		echo '<li><a href="station_details.php?station_id='.$getStations->return->station_id.'">'.$getStations->return->city.'</a></li>';
	}
?>
	
</ul>

<!-- Include the footer area of the website -->
<?php include('includes/footer.php'); ?>